package com.liuym.student.service;

import com.liuym.common.exception.StudentException;
import com.liuym.student.repository.model.bo.StudentBO;
import com.liuym.student.repository.model.bo.StudentScoreBatchBO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author LiuYiMing
 * @date 2018/9/18 11:43
 * @describe：
 */
public interface StudentService {
    /**
     * 通过学号获取学生信息
     *
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    StudentBO getStudentByNumber(long studentNumber) throws StudentException;

    /**
     * 获取全部学生信息
     *
     * @return
     * @throws StudentException
     */
    List<StudentBO> getAllStudent() throws StudentException;

    /**
     * 通过班号获取学生信息
     *
     * @param classNumber
     * @return
     * @throws StudentException
     */
    List<StudentBO> getStudentByClass(long classNumber) throws StudentException;

    /**
     * 添加学生
     *
     * @param studentBO
     */
    int addStudent(StudentBO studentBO) throws StudentException;

    /**
     * 批量添加学生信息
     *
     * @param studentBOList
     * @return
     * @throws StudentException
     */
    Map<String, Object> addStudentList(List<StudentBO> studentBOList) throws StudentException;
    /**
     * 根据学号删除学生
     *
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    int deleteStudentByStudentNumber(long studentNumber) throws StudentException;

    /**
     * 根据学号删除学生
     *
     * @param classNumber
     * @return
     * @throws StudentException
     */
    int deleteStudentByClassNumber(long classNumber) throws StudentException;

    /**
     * 更新学生信息
     *
     * @param studentBO
     * @return
     * @throws StudentException
     */
    int updateStudent(StudentBO studentBO) throws StudentException;

    /**
     * 更新学生分数
     *
     * @param score
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    int updateScoreByStudentNumber(int score, long studentNumber) throws StudentException;

    /**
     * 更新学生分数
     *
     * @param studentScoreBatchBOList
     * @return
     * @throws StudentException
     */
    int updateScoreByStudentNumberBatch(List<StudentScoreBatchBO> studentScoreBatchBOList) throws StudentException;

    /**
     * 更新学生分数为80
     *
     * @return
     */
    int updateStudentScoreTo80() throws StudentException;

    /**
     * 查询学生历史记录
     * @param studentScoreTable
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    Map<String, Object> findHistoryScore(String studentScoreTable, long studentNumber) throws StudentException;

    /**
     * 根据班号统计学生数量
     *
     * @param classNumber
     * @return
     */
    Integer getCountByClassNumber(long classNumber);

    void logout(String token);

    void resetPassword(StudentBO student) throws StudentException;
}
